var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    content:'',
    search_show: false
  },
  onLoad: function (options) {
    
    this.setData({
      shop_id: options.shop_id,
      content:''
    })
    
  },
  //获取用户输入的用户名
  contentInput: function (e) {
    if (e.detail.value) {
      this.setData({
        content: e.detail.value,
        search_show: true
      })
    } else {
      this.setData({
        search_show: false
      })
    }
    
  },
   //事件处理函数
  bindViewTap: function (e) {
    var that = this;
    var content = that.data.content
    var shop_id = that.data.shop_id
    
    var urls = '../store_goods_list/store_goods_list?content=' + content + '&shop_id='+shop_id
    wx.redirectTo({
      url: urls
    })
  },
  //删除搜索框内容
  search_clear: function () {
    var that = this
    that.setData({
      content: '',
      search_show: false
    })
  }
})